﻿using System;
using System.Collections.Generic;
using System.Text;

namespace efcoredemo.Entity
{
    public class UserDept
    {
        private UserDept() { }
        public UserDept(long? userId, long? deptId)
        {
            if (userId.HasValue)
                UserId = userId.Value;

            if (deptId.HasValue)
                DeptId = deptId.Value;
        }
        public UserDept(long? id, long? userId, long? deptId)
        {
            if (id.HasValue)
                Id = id.Value;

            if (userId.HasValue)
                UserId = userId.Value;

            if (deptId.HasValue)
                DeptId = deptId.Value;
        }
        public long Id { get; private set; }
        public long UserId { get; private set; }
        public virtual User User { get; private set; }
        public long DeptId { get; private set; }
        public virtual Dept Dept { get; private set; }
    }
}
